package net.neptech.util;

import cn.hutool.extra.spring.SpringUtil;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.runtime.Execution;

/**
 * @Author Saya
 * @Date 2025/8/22 15:21
 * @Description TODO
 **/
public class ExecutionUtil {
    /**
     * 查询上级的执行id
     */
    public static String getParentExecutionId(String executionId) {
        RuntimeService runtimeService = SpringUtil.getBean(RuntimeService.class);
        Execution execution = runtimeService.createExecutionQuery().executionId(executionId).singleResult();
        if (execution == null) {
            return null;
        }
        return execution.getParentId();
    }
}
